<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../css/public.css">
</head>
<body>
    <!-- stroke 绘制已定义的路径 -->

    <canvas id="myCanvas1" width="300" height="150" style="border:1px solid #d3d3d3;"></canvas>

    <script>

        var b = document.getElementById('myCanvas1');
        var btx = b.getContext('2d');
        btx.beginPath();
        btx.lineWidth = 1;
        btx.moveTo(20,20);
        btx.lineTo(20, 100);
        btx.lineTo(70, 100);
        btx.strokeStyle = 'green';
        btx.stroke();

    </script>
</body>
</html>